package com.mengtian_tech.smart_lab.controller.console.system;

import java.util.List;

import org.jeecgframework.core.util.ContextHolderUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.mengtian_tech.smart_lab.entity.system.TSDepart;
import com.mengtian_tech.smart_lab.entity.system.TSUser;
import com.mengtian_tech.smart_lab.service.system.OrgnizationService;

@Controller
@RequestMapping("orgnization")
public class OrgnizationController {
	@Autowired
	OrgnizationService orgnizationService;
	
	/**
	 * 获取当前用户所在机构的上级部门的所有用户
	 * @return
	 */
	@RequestMapping("findCurrentUserParentOrgUsers.do")
	@ResponseBody
	public List<TSUser> findCurrentUserParentOrgUsers(){
		TSDepart currentDepart = ContextHolderUtils.getCurrentUser().getCurrentDepart();
		return orgnizationService.findParentOrgUserList(currentDepart.getId());
	}
}
